<!DOCTYPE HTML>
<html>
<head>
  <title></title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <base href="http://clickmobile.com/" />
  <link rel="stylesheet" type="text/css" href="<?php echo $stylePath.'css/bootstrap.min.css' ;?>">
  <link rel="stylesheet" type="text/css" href="<?php echo $stylePath.'css/otherstyle.css';?>">
  <script type="text/javascript" src="<?php echo $stylePath.'js/jquery.min.js'; ?>"></script>  
</head>
<body>
  <div class="container well">
    <div class="row">
      <div class="span2">
      <div class="logo"></div>
      </div>
      <div class="span3 offset7">
        <div class="account">
          <div class="btn-group pull-right">
                <a class="btn btn-info" href="admin.php/account"><i class="icon-user icon-white"></i>Thông tin tài khoản</a>
                <a class="btn btn-info" href="admin.php/login/logout"><i class="icon-off icon-white"></i></a>
              </div>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="span12">
      <div class="navbar">
            <div class="navbar-inner">
                <div class="container">
                  <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                  </a>
                  <a class="brand" href="admin.php/home">Quản trị</a>
                  <div class="nav-collapse">
                    <ul class="nav">
                      <li class="divider-vertical"></li>
                      <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Người dùng <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                          <li><a href="admin.php/user">Danh sách</a></li>
                          <li class="divider"></li>
                          <li><a href="admin.php/user/add">Thêm mới</a></li>
                        </ul>
                      </li>
                      <li class="divider-vertical"></li>
                      <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Sản phẩm <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                          <li class="nav-header">Sản phẩm</li>                          
                          <li><a href="#">Danh mục</a></li>
                          <li><a href="#">Thêm mới</a></li>
                          <li class="divider"></li>
                          <li class="nav-header">Nhóm sản phẩm</li>
                          <li><a href="#">Nhóm sản phẩm</a></li>
                          <li><a href="#">Nhà sản xuất</a></li>
                          <li class="divider"></li>
                          <li class="nav-header">Thuộc tính</li>
                          <li><a href="#">Danh mục</a></li>                                                    
                        </ul>
                      </li>
                      <li class="divider-vertical"></li>                      
                      <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Bán hàng <b class="caret"></b></a>
                        <ul class="dropdown-menu">                         
                          <li><a href="#">Đơn hàng</a></li>
                          <li class="divider"></li>                      
                          <li><a href="#">Phương thức thanh toán</a></li>
                        </ul>
                      </li>
                      <li class="divider-vertical"></li>                                            
                      <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Mở rộng <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                          <li class="nav-header">Thông tin</li>                          
                          <li><a href="#">Trang thông tin</a></li>
                          <li class="divider"></li>
                          <li class="nav-header">Mở rộng</li>
                          <li><a href="#">SlideShow</a></li>
                          <li><a href="#">Banner</a></li>                         
                        </ul>
                      </li>
                      <li class="divider-vertical"></li>                                            
                      <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Báo cáo - thống kê <b class="caret"></b></a>
                        <ul class="dropdown-menu">                        
                          <li><a href="#">Xuất dữ liệu</a></li>
                          <li class="divider"></li>
                          <li><a href="#">Báo cáo</a></li>
                          <li class="divider"></li>
                          <li><a href="#">Biểu đồ</a></li>
                        </ul>
                      </li>
                      <li class="divider-vertical"></li>                                            
                      <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Hệ thống <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                        </ul>
                      </li>
                      <li class="divider-vertical"></li>                                            

                    </ul>
                  </div><!-- /.nav-collapse -->
                </div>
              </div><!-- /navbar-inner -->
            </div>
      </div>
    </div>
  	<div class="row">
  		<div class="span2 side-bar">
        <ul class="nav nav-list">
          <li class="nav-header">Quản trị người dùng</li>
          <li class="active"><a href="admin.php/user">Danh sách</a></li>
          <li><a href="admin.php/user/add">Thêm mới</a></li>
        </ul>
  		</div>
      <div class="span9 pull-right main-content">
        <div class="filter">
          <div class="form-inline">
            <input type="text" class="" placeholder="Tên"  id="filter-name" >
            <input type="date" class="" placeholder="Sinh nhật"   id="filter-birthday" >
            <input type="text" style="width:150px" placeholder="Điện thoại"   id="filter-phone" >
            <input type="text" class="" placeholder="Email" id="filter-email" >  
            <button type="submit" style="width:60px" class="btn pull-right btn-info" id="action-filter"><i class="icon-filter icon-white"></i></button>          
          </div>
        </div>
        <div id="customer-list">       
        </div>
        <div class="control-list">
          <img src="<?php echo $stylePath.'/img/arrow_ltr.png' ?>" style="float:left">
          <div class="btn-group" style="float:left; padding-right:5px">
            <button class="btn btn-small btn-success" id="checkAll"><i class="icon-ok icon-white"></i></button>
            <button class="btn btn-small btn-success" id="uncheckAll"><i class="icon-remove icon-white"></i></button>
          </div>
          <div class="btn-group" style="float:left; padding-right:5px">
            <button class="btn btn-small btn-danger" id="deleteAll"><i class="icon-trash icon-white"></i> Xóa</button>
          </div>
          <a class="btn btn-small btn-info" href="admin.php/user/add"><i class="icon-plus icon-white"></i> Thêm mới</a>
        </div>
      </div>
  	</div>
  	<div class="row">
  		<div class="span12 footer">
	        <a href="#"> Trang quản trị </a> | <a href="#"> Trang người dùng </a> | <a href="#"> Trợ giúp kĩ thuật </a>
	        <div class="pull-right">
	        <a href="#">© 2012 ClickMobile</a>  
        </div>
  		</div>
  	</div>   
  </div>
<script type="text/javascript" src="<?php echo $stylePath.'js/jquery.min.js'; ?>"></script>
<script type="text/javascript" src="<?php echo $stylePath.'js/bootstrap.min.js';?>"></script> 
<script type="text/javascript">
    $('input[id^="filter"]').ready(function() {
        return getListCustomer();
    });  
    $('input[id^="filter"]').keyup(function(e) {
      if(e.keyCode == 13) {
        return getListCustomer();
      }
    });
    $('#action-filter').click(function(){
      return getListCustomer();
    });             
    function getListCustomer()
    {
      var name = $("#filter-name").val();
      var birthday =  $("#filter-birthday").val();
      var phone =  $("#filter-phone").val();
      var email =  $("#filter-email").val();
      $.ajax({
        url: 'http://clickmobile.com/admin.php/user/filter',
        type:'POST',
        data: 'name='+name+'&birthday='+birthday+'&phone='+phone+'&email='+email,
        asynce :true,
        success: function(result){
          $('#customer-list').html(result);
        }
      });
    }
    $('#checkAll').click(function(){
      $('input[id^="checkbox"]').attr('checked',true);
    });
    $('#uncheckAll').click(function(){
      $('input[id^="checkbox"]').attr('checked',false);
    });
    $('#deleteAll').click(function(){
      var checkedid = '';
      $('input[id^="checkbox"]').each(function(){
        if(this.checked){
          var val = $(this).attr('id');
          checkedid += val.substring(8)+',' ;
        }
      })
      var name = $("#filter-name").val();
      var birthday =  $("#filter-birthday").val();
      var phone =  $("#filter-phone").val();
      var email =  $("#filter-email").val();
      $.ajax({
        url: 'http://clickmobile.com/admin.php/user/filter',
        type:'POST',
        data: 'name='+name+'&birthday='+birthday+'&phone='+phone+'&email='+email+'&checkedid='+checkedid,
        asynce :true,
        success: function(result){
          $('#customer-list').html(result);
        }
      });
    })    
</script>
</body>
</html>
